<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Send Request Example</title>
</head>
<body>
<h1>Send Request to Server</h1>
<button id="sendRequest">Send Request</button>

<script>
    document.getElementById('sendRequest').addEventListener('click', function() {
        fetch('http://8.153.19.149:8080/hello')
            .then(response => {
                if (!response.ok) {
                    throw new Error('Network response was not ok');
                }
                return response.json();
            })
            .then(data => {
                console.log('Success:', data);
                alert('Response received: ' + JSON.stringify(data));
            })
            .catch((error) => {
                console.error('Error:', error);
                alert('Failed to fetch data: ' + error.message);
            });
    });
</script>
</body>
</html>